<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jq-3.6.0.js"></script>
</head>

<body>
    <button class="bn1">点击添加之后</button>
    <button class="bn2">点击添加之前</button>
    <button class="bn3">兄弟元素的添加之前</button>
    <button class="bn4">兄弟元素的添加之后</button>
    <button class="bn5">点击删除本身</button>
    <button class="bn6">删除孩子节点1</button>
    <button class="bn7">删除孩子节点2</button>
    <div class="box">
        <div>hello</div>
    </div>
</body>
<script>
    var box = $('.box');
    $('.bn1').click(function() {
        var div = $('<div>你好0</div>')
        box.append(div)
    })
    $('.bn2').click(function() {
        var div = $('<div>你好1</div>')
        box.prepend(div)
    })
    $('.bn3').click(function() {
        var div = $('<div>你好3</div>')
        box.before(div)
    })
    $('.bn4').click(function() {
        var div = $('<div>你好4</div>')
        box.after(div)
    })
    $('.bn5').click(function() {
        box.remove()
    })
    $('.bn6').click(function() {
        box.empty()
    })
    $('.bn7').click(function() {
        box.html('');
    })
</script>

</html>